<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib uri="/struts-tags" prefix="s" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'addUserinfo.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
<script type="text/javascript">
		function init(){
			document.userinfo.password.focus;
		}
		function u(){
	  var departname=document.getElementById("username").value;
	  if(departname==null || departname==""){
	   alert("员工名称不能为空，请输入员工名称");
	   return false;
	  }
	}
		function ckuserinfo(){
			var pwd1=document.getElementById("pwd1").value;
			var pwd2=document.getElementById("pwd2").value;
			if(pwd1!=pwd2){
				document.getElementById("did2").innerHTML="前后两次输入密码不同";
			}else{
				document.getElementById("did2").innerHTML="";
			}
		}
	</script>
  </head>
  
  <body>
  <s:form action="userinfoactionsave" method="post" namespace="/" enctype="multipart/form-date" onsubmit="return u()">
    <a>当前位置：保存用户信息</a>
    <center>
    	<h2>保存用户信息</h2>
    	<hr style="border: 1px solid;"><br>
    	<div>
    	<table height="500px;">
    		<tr>
    			<td>真实姓名:</td>
    			<td><s:textfield name="u.username" id="username"></s:textfield></td>
    		</tr>    		
    		<tr>
    			<td>密&nbsp;&nbsp;&nbsp;&nbsp;码：</td>
    			<td><s:textfield name="u.password" id="pwd1"></s:textfield></td>
    		</tr>
    		<tr>
    			<td>确认密码：</td>
    			<td><s:textfield name="password" id="pwd2" onblur="ckuserinfo()"></s:textfield></td>
    			<td id="did2"></td>
    		</tr>    				
    		<tr>
    			<td>所在部门:</td>
    			<td><s:textfield name="u.departid"></s:textfield></td>
    			
    		</tr>
    		<tr>
    			<td>性	  别：</td>
    			<td><input name="u.gender" type="radio" value="1">男&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input name="u.gender" type="radio" value="2">女</td>
    		</tr>
    		<tr>
    			<td><img src="admin_cg/zhk/image/person.gif" style="height: 40px;width: 40px;" /></td>
    			<td><input type="file"  /></td>
    		</tr>
    		<tr>
    			<td>角色:</td>
    			<td><s:select name="u.roleinfo.roleid" list="%{#session.rList}" listKey="roleid" listValue="rolename"></s:select></td>
    		</tr>
    		<tr>
    			<td>当前状态:</td>
    			<td><s:select name="u.userstate.userstateid" list="%{#session.uslist}" listKey="userstateid" listValue="userstatename"></s:select></td>
    		</tr>
    	</table>    	
    		<s:submit value="保存"></s:submit>&nbsp;&nbsp;&nbsp;&nbsp;<s:reset value="全部重写"></s:reset>&nbsp;&nbsp;&nbsp;&nbsp;<input type="button" onclick="location.href='/OAProject/admin_pg/zhk/showUserInfo.jsp'" value="返回">
    	</div>
    </center>
   </s:form>
  </body>
</html>
